﻿using System;
using System.Collections.Generic;
using System.Text;
using RS.DOM.Common;

namespace RS.DOM.Types
{
    public class New: Token
    {
        public New(Context context)
            : base(context)
        {

        }

        public override Token Operation(Token token, OperationType type)
        {
            Token result = new Bool(this.Context, true);

            if (type == OperationType.Apply)
            {
                if (token.TokenType == TokenType.Number)
                {
                    Number op2 = (Number)token;
                    this.Context.Group.Numbers.Result.Add(new Number(this.Context, op2.Result));
                }
            }
            else
            {
                base.Operation(token, type);
            }

            return result;
        }
    }
}
